<template>
    <div>
        <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="onClickLeft" />
         <van-skeleton title :row="3" v-show="gjp"/>
        <div v-for="item in search">
            <router-link :to="{ name: 'detail', params: { goods_id: item.goods_id } }">
                <van-card :price="item.goods_price" :title="item.goods_name"
                    :thumb="item.goods_small_logo ? item.goods_small_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />

            </router-link>

        </div>

    </div>
</template>

<script setup>
import { ref } from 'vue';
import { searchApi } from '@/api/api';
let search = ref([])
import { useRoute } from 'vue-router';
const route = useRoute()
// console.log(route.params.query)
searchApi(route.params.query).then(res => {
    console.log('列表', res)
    search.value = res.data.message.goods

})
let gjp=ref(true)
setInterval(()=>{
    gjp.value=false
},1000)


</script>

<style lang="scss" scoped></style>